package h_eekwan.basic;

import java.util.Scanner;

public class Ex72_OOP {

	public static void main(String[] args) {
		// 객체와 동일한 자료형 선언
		Ex72_Retangle ret = new Ex72_Retangle();
		Ex73_Fan fan = new Ex73_Fan();
		Ex74_Account acc = new Ex74_Account();
		Ex75_Stock sto = new Ex75_Stock();
		
		/*Scanner sc = new Scanner(System.in);
		ret.width = sc.nextDouble();
		ret.height = sc.nextDouble();
		ret.color = sc.next();
		
		System.out.println((int)ret.width + "," + (int)ret.height + "," + ret.color);
		sc.close();
		*/
//		System.out.println((int)ret.width + ","+(int)ret.height+"," + ret.color);
		System.out.println("EX_72.");
		ret = new Ex72_Retangle(4, 40, "red");
//		ret.width = 4;
//		ret.height = 40;
//		ret.color = "red";
		System.out.print((int)ret.width + ","+(int)ret.height+"," + ret.color + " / ");
//		ret.width = 3.5;
//		ret.height = 35.9;
//		ret.color = "orange";
		
		ret = new Ex72_Retangle(3.5, 35.9, "orange");
		System.out.println(ret.width + "," + ret.height + "," + ret.color);
		
		System.out.println("사각형의 면적 : " + ret.getArea());
		System.out.println("사각형의 둘레 : " + ret.getCircum());
		
		System.out.print("EX_73.");
		fan.radius = 10;
		fan.color = "yellow";
		fan.fast = "최고속도";
		fan.on = "동작중"; 
		
		System.out.println((int)fan.radius+","+fan.color+","+fan.fast+","+fan.on);
		
		System.out.print("Ex_74.");
		acc.aid = "1122";
		acc.balance = 20000;
		acc.interestRate = 4.5;
		acc.dateCreated = "2014-08-15 14:34:29";
		System.out.println(acc.aid +", "+acc.balance+", "+acc.interestRate+", "+acc.dateCreated);
		
		
	}	// main

}	 // class

class Ex72_Retangle{
	double width;
	double height;
	String color;
	double area;
	double circum;
	// 초기화는 퍼블릭 안에다가 쓰는게 좋음
	public Ex72_Retangle() {
		// 생성자 : 객체 생성 및 멤버변수 초기화
		width = 1.0;
		height = 1.0;
		color = "white";
	}	// 기본 생성자
	public Ex72_Retangle(double width, double height, String color){
		this.width = width;
		this.height = height;
		this.color = color;
		
	}	// 사용자 정의 생성자
	double getArea(){
		area = width*height;
		return area;
	}
	
	double getCircum(){
		circum = getArea() * 2;
		return circum;
	}
}	// Retangle

class Ex73_Fan{
	String slow;
	String medium;
	String fast;
	String speed;
	String on;
	double radius;
	String color;
	
	public Ex73_Fan(){
		speed = slow;
		on = "false";
		radius = 5.0;
		color = "blue";
		
	}	
	
}	// Fan

class Ex74_Account{
	String aid;
	int balance;
	double interestRate;
	String dateCreated;
	int getMonthlyInterestRate;
	
	public Ex74_Account(){
		aid = "0";
		balance = 0;
		interestRate = 0;	
	}
	
}	// Account

class Ex75_Stock{
	
}	// Stock


